package com.cloudfun.campusshare.entity;

import com.cloudfun.campusshare.common.constant.ProductType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.time.LocalTime;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/8 19:43
 * @description :
 */
@Data
@Entity
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "device_service_time")
public class DeviceServiceTimeEntity extends CreatorPersistenceEntity {
    @Id
    @GenericGenerator(name = "id_uuid", strategy = "uuid")
    @GeneratedValue(generator = "id_uuid")
    @Column(name = "id", unique = true, columnDefinition = ("varchar(40) not null comment '主键uuid'"))
    private String id;

    @Column(name = "start_time", columnDefinition = ("time not null comment '开始服务时间'"))
    private LocalTime startTime;

    @Column(name = "end_time", columnDefinition = ("time not null comment '开始服务时间'"))
    private LocalTime endTime;

    @Column(name = "merchant_id", columnDefinition = ("varchar(40) not null comment '商家id'"))
    private String merchantId;

    @Column(name = "belong_merchant_name", columnDefinition = ("varchar(64) not null comment '归属商家名称'"))
    private String belongMerchantName;

    @Column(name = "wash_point_id", columnDefinition = ("varchar(40) not null comment '洗衣点Id'"))
    private String washPointId;

    @Column(name = "wash_point_name", columnDefinition = ("varchar(64) default null comment '洗衣点名称'"))
    private String washPointName;


    @Column(name = "product_type", columnDefinition = ("varchar(40) not null comment '产品类型'"))
    @Enumerated(EnumType.STRING)
    private ProductType productType;
}
